import request from '@/utils/request'
export function getCrons(boxNo) {
  return request({
    url: `/iot/hgbox/cron/${boxNo}`, // 使用反引号和模板字符串
    method: 'get'
  });
}
export function listHgbox1() {
  return request({
    url: '/iot/hgbox/counts',
    method: 'get',
  });
}
// 查询历史记录列表
export function listHistory(query) {
  return request({
    url: '/iot/hgbox/history',
    method: 'get',
    params: query
  })
}
// 查询慧光智慧盒子列表
export function listHgbox(query) {
  return request({
    url: '/iot/hgbox/list',
    method: 'get',
    params: query
  })
}
export function listtHgbox(params) {
  return request({
    url: '/iot/hgbox/listt',
    method: 'get',
    params
  })
}

// 查询慧光智慧盒子详细
export function getHgbox(id) {
  return request({
    url: '/iot/hgbox/' + id,
    method: 'get'
  })
}

// 新增慧光智慧盒子
export function addHgbox(data) {
  return request({
    url: '/iot/hgbox',
    method: 'post',
    data: data
  })
}

// 修改慧光智慧盒子
export function updateHgbox(data) {
  return request({
    url: '/iot/hgbox',
    method: 'put',
    data: data
  })
}

// 删除慧光智慧盒子
export function delHgbox(id) {
  return request({
    url: '/iot/hgbox/' + id,
    method: 'delete'
  })
}
export function publish(snThing) {
  return request({
    url: '/mqtt/backclient/publish',
    method: 'post',
    data: snThing
  });
}
